<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Gass_auth_demo extends CI_Controller {
  function __construct() 
  {
    parent::__construct();   	
		// Load required CI libraries and helpers.
		//$this->load->database();
		$this->load->library('session');
 		$this->load->helper('url');
 		//$this->load->helper('form');
 		
    //$this->auth = new stdClass;
		//$this->load->library('flexi_auth');	
		$this->load->library('Person_info');	
		$this->data = null;
		//调试使用
		//$this->output->enable_profiler(TRUE);
  }
  function index(){
		// Get any status message that may have been set.
		$this->data['message'] = (! isset($this->data['message'])) ? $this->session->flashdata('message') : $this->data['message'];		
    $this->load->view('demo_dashboard_view', $this->data);
 	}  
 	
  function other_method(){
  	
  	$this->session->set_flashdata('message', '<p class="error_msg">哈喽</p>');
		//redirect('gass_auth_demo');
		
		// Get any status message that may have been set.
		$this->data['message'] = (! isset($this->data['message'])) ? $this->session->flashdata('message') : $this->data['message'];		
    $this->load->view('demo_method_view', $this->data);
 	} 
 	
 	function soap() {
    //$server = new SoapServer ( null, array ('soap_version' => SOAP_1_2, 'uri' => 'http://localhost/' ) );
    //$server->setClass("Person_info");
    //$server->handle ();
	 $this->load->model('gass_auth_demo_model');  
	 $xml = $this->gass_auth_demo_model->get_xml(); 
	 //echo '<link>'.$xml->channel->link.'<title>'.$xml->channel->title.'</title></link>';
	 //var_dump($xml);
	 var_dump('<aaa><title>'.$xml->channel->title.'</title><link>'.$xml->channel->link.'</link></aaa>');

  }
  
  function soap_client(){
  	/*
   try{
     //wsdl方式调用web service
     //wsdl方式中由于wsdl文件写定了，如果发生添加删除函数等操作改动，不会反应到wsdl，相对non-wsdl方式
     //来说不够灵活
     //$soap = new SoapClient("http://localhost/Test/MyService/PersonInfo.wsdl");
     
     //non-wsdl方式调用web service    
     //在non-wsdl方式中option location系必须提供的,而服务端的location是选择性的，可以不提供
     $soap = new SoapClient(null,array('location'=>"http://localhost/gass/index.php/gass_auth_demo/soap",'uri'=>'http://localhost/'));
     
     //两种调用方式，直接调用方法，和用__soapCall简接调用
     $result1 = $soap->getName();
     $result2 = $soap->__soapCall("getName",array());
     echo $result1."<br/>";
     echo $result2;
     
   }catch(SoapFault $e){
     echo $e->getMessage();
   }catch(Exception $e){
     echo $e->getMessage();
   }*/
	 //$xml = simplexml_load_file("http://localhost/gass/index.php/gass_auth_demo/soap");
   
   //var_dump($xml);
   //$this->load->view('demo_dashboard_view', $this->data);
    show_404();
  }


}